/*=+--+=#=+--     Unmanned Aerial System Management Software      --+=#=+--+=#*\
|          Copyright (C) 2011 Regents of the University of Colorado.           |
|                             All Rights Reserved.                             |

     This program is free software: you can redistribute it and/or modify
     it under the terms of the GNU General Public License version 2 as
     published by the Free Software Foundation.

     This program is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.

     You should have received a copy of the GNU General Public License
     along with this program.  If not, see <http://www.gnu.org/licenses/>.

            Jack Elston                       Cory Dixon                        
|           elstonj@colorado.edu              dixonc@colorado.edu              |
|                                                                              |
\*=+--+=#=+--                 --+=#=+--+=#=+--                    --+=#=+--+=#*/

/*!
  \file ipmt.h

  \author Cory Dixon
*/

#ifndef __IPMT_H
#define __IPMT_H

#include "threadedPipe.h"
#include "interface.h"
#include "socket.h"

class IPMT : public ThreadedPipe
{
	private:
		TestType   test_type;
		float      test_time;

		Socket *udp_server_sock;
		Socket *tcp_server_sock;
		Socket *client_sock;

		String target_host;
		String udp_portStr;
		String tcp_portStr;

		unsigned int n_tx;
		unsigned int nb_tx;
		float        rate_tx;

		unsigned int n_rx;
		unsigned int nb_rx;
		float        rate_rx;

		TimeStamp    loop_ts;
	public:
		IPMT(String name);
		~IPMT();

		bool init(ShmStruct * shmStructPtr);
		void update();
};

#endif
